package com.shcowin.biz.impl;

import java.util.List;

import javax.inject.Inject;

import org.springframework.dao.DataAccessException;
import org.springframework.stereotype.Service;

import com.shcowin.biz.ProductsBiz;
import com.shcowin.dao.ProductsDao;
import com.shcowin.entity.Products;
/**
 * function: Account Biz�ӿ�ʵ��
 * @author hoojo
 * @createDate 2011-4-13 ����11:34:39
 * @file AccountBizImpl.java
 * @package com.hoo.biz.impl
 * @project MyBatisForSpring
 * @blog http://blog.csdn.net/IBM_hoojo
 * @email hoojo_@126.com
 * @version 1.0
 */
//@Component
@Service
public class ProductsBizImpl <T extends Products> implements ProductsBiz<T> {
    
    @Inject
    private ProductsDao dao;
    
    public boolean add(T entity) throws DataAccessException {
			return dao.add(entity);
    }
    
    public boolean edit(T entity) throws DataAccessException {
		return dao.edit(entity);
}
 
    public T getById(Integer id) throws DataAccessException {
        return (T) dao.getById(id);
    }
    
    public T getByName(String name) throws DataAccessException {
        return (T) dao.getByName(name);
    }
 
    public List<T> getAll() throws DataAccessException {
        return (List<T>) dao.getAll();
    }

	public void del(int id) throws DataAccessException {
		dao.del(id);
		
	}

	public List<T> getByPage(int start,int end) throws DataAccessException {
		return (List<T>) dao.getByPage(start, end);
	}

	public int getCount() throws DataAccessException {
		return dao.getCount();
	}

	public List<Products> getByHomeMark() {
		return dao.getByHomeMark();
	}

	public int getHomeMarkCount() {
		return dao.getHomeMarkCount();
	}
}
